import { _decorator, Component, Animation, AnimationComponent, UITransform, AnimationState, AnimationClip } from 'cc';
import { UIManager } from '../../framework/manager/uiManager';
import { Constant } from '../../Enum/Enum';
const { ccclass, property } = _decorator;

@ccclass('loading01')
export class loading01 extends Component {
    private static LOADINGMin: string = 'loading01';
    private _loadSceneOver: boolean = false;
    private _sceneName: string = '';

    @property(Animation)
    public framAnimation: Animation = null!;

    show(panelNmae: string) {
        let animationState:AnimationState =   this.framAnimation.getState(loading01.LOADINGMin);
        animationState.wrapMode = AnimationClip.WrapMode.Loop;
        this.framAnimation.play(loading01.LOADINGMin);

        // setTimeout(() => {
        //     if ( panelNmae !== undefined && panelNmae.match(/^.*$/)) {
        //         UIManager.instance.showDialog(panelNmae, [], () => {
        //             UIManager.instance.hideDialog(Constant.PANEL_NAME.LOADING01);
        //         })
        //     } else {
        //         UIManager.instance.hideDialog(Constant.PANEL_NAME.LOADING01);
        //     }
        // }, 7200);
    }

}

